<include file="Public:header" />
<div id="zoneHeader">
    <h2>增加智能广告位</h2>
    <ul>
        <li><button type="button" class="zn_zone-save-btn">保存</button></li>
        <li><a href="?m={$Think.const.MODULE_NAME}" class="btn">返回</a></li>
    </ul>
</div><!--/#zoneHeader-->
<style type="text/css">
#zn_zone-add2-container {}
#zn_zone-add2-container p{padding:10px 0 0 100px;}
#zn_zone-show-container {width:100%; border:0;}

#zn_zone-get-code {}
#zn_zone-get-code__js {}
#zn_zone-get-code__html {}

#zn_zone-get-code__js {float:left; width:49%;}
#zn_zone-get-code__html {float:right; width:49%;}

#zn_zone-get-code__js h5, #zn_zone-get-code__html h5{text-align:center; }
#zn_zone-get-code__js textarea, #zn_zone-get-code__html textarea {height:200px;}
</style>
<div id="zoneBody" class="noFooter">
    <div id="zoneBodyContent">
        <form id="formEdit">
            <div id="zn_zone-add2-container">
                <dl class="dl2Col">
                    <dt>广告位名称：</dt>
                    <dd>
                        <input type="text" name="zone_name" class="fW50" />
                        <div class="formTips2">如果不填写，系统会自动生成广告位名称</div>
                    </dd>
                    <dt>广告样式：</dt>
                    <dd>
                        <label><input type="radio" name="zone_type" value="zn_tw" checked="checked" /><span>图文混合</span></label>
                        <label><input type="radio" name="zone_type" value="zn_text" /><span>纯文字</span></label>
                    </dd>
                    <dt>尺寸：</dt>
                    <dd>
                        宽<input type="text" name="zone_width" class="fW50p" /> X 高<input type="text" name="zone_height" class="fW50p" />
                        <span class="formTips">图文混合最小尺寸为120x90px，纯文字最小尺寸为100x20px</span>
                    </dd>
                    <dt>位置：</dt>
                    <dd>
                        <ul>
                            <li><label><input type="radio" name="zone_pos_type" value="0" checked="checked" /><span>无</span></label></li>
                            <li><label><input type="radio" name="zone_pos_type" value="31" /><span>对联</span></label><span class="formTips">对联建议尺寸：宽度最大不超过160px，高度最大不超过600px</span></li>
                            <li><label><input type="radio" name="zone_pos_type" value="32" /><span>右下角漂浮</span></label><span class="formTips">右下角漂浮建议尺寸：宽度和高度最大值都不超过320px<span></li>
                            <li><label><input type="radio" name="zone_pos_type" value="33" /><span>左下角漂浮</span></label><span class="formTips">左下角漂浮建议尺寸：宽度和高度最大值都不超过320px</span></li>
                        </ul>
                    </dd>
                </dl>
                <p>
                    <button type="button" id="zn_zone-save-btn">保存</button>
                    <button type="button" id="zn_zone-preview-btn">预览</button>
                </p>
                <iframe src="about:blank" id="zn_zone-show-container"></iframe>
            </div> <!--/#zone-add2-container--> 
        </form>
    </div><!--/#zoneBodyContent-->
</div><!--/#zoneBody-->

<script type="text/javascript">
$(function() {
    $('#zn_zone-preview-btn').on('click', function() {
        var $o = $('#zoneBodyContent');

        try {
            var param = ZnZone.getFormValue($o);
        } catch(e) {
            alert(e.message);

            return false;
        }

        ZnZone.preview(param);
    });

    $('#zn_zone-save-btn').on('click', function() {
        ZnZone.doSave($('#formEdit'));
    })
});
</script>

<include file="Public:footer" />
